#ifndef _ADCINPUT_H
#define _ADCINPUT_H

typedef struct ADCinput_t{
	tt_object_t obj;
	uint16_t ADC4val;
	uint16_t ADC5val;
	uint16_t ADC6val;
	uint16_t ADC8val;
	uint16_t ADC9val;
	uint8_t ADC4enabled;
	uint8_t ADC5enabled;
	uint8_t ADC6enabled;
	uint8_t ADC8enabled;
	uint8_t ADC9enabled;
	uint16_t sampleTime;
} ADCinput_t;


extern ADCinput_t ADCinput;

// Sets PINF4 to a input.
#define ADC_INIT()	DDRB &= ~(1 << DDB2)|(1<<DDB5); \
					PORTB &= ~(1<<PORTB2)|(1<<PORTB5); \
					DDRC &= ~(1<< DDC4)|(1<<DDC5); \
					PORTC &= ~(1<<PORTC4)|(1<<PORTC5)

#define ON 1
#define OFF 0

#define ADC4 4
#define ADC5 5
#define ADC6 6
#define ADC8 8
#define ADC9 9

//#define SAMPLETIME 100
//#define OFFSET 448
//#define RANGE 120


// The initiationfunction that starts the convertingprosess
void ADCInit(ADCinput_t *self, void *none);
void ADCRead(ADCinput_t *self, void *none);

#endif
